package doc2db.interfaces.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author yura
 */
public interface GUIAction extends ActionListener{

    /**
     * Call at start of actionPerformed.
     * If returneded false, action not be preformed,
     * and call showMessage dialor with text from
     * getMsg method.
     * @return True if init succesful
     */
    public boolean start();

    /**
     * Return true if action ended succefuly.
     * If returned false next action not preformed
     * @return true if action ended succefuly
     */
    public boolean end();

    /**
     * Invoked when an action occurs.
     * @param e ActionEvent
     */
    public void action(ActionEvent e);

    @Override
    public void actionPerformed(ActionEvent e);

    /**
     * If was any error at start method called
     * @return error message
     */
    public String getMsg();
}
